import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { RoomVideoModal } from '@modals/room-video/room-video';



@Component({
    selector: 'nav-switch',
    templateUrl: './nav-switch.html',
    styleUrls: ['nav-switch.scss']
})
export class NavSwitchComponent implements OnInit {
    @Input() navs;
    @Input() showVideo;
    @Output() navChange: EventEmitter<any> = new EventEmitter();
    @Output() openVideo: EventEmitter<any> = new EventEmitter();


    constructor(public modalCtrl: ModalController) {
    }

    ngOnInit() {
        if (!this.navs.aim) {
            this.navs.aim = 0;
        }
    }

    aim(i) {
        console.log(this.navs)
        this.navs.aim += i;
        this.navChange.emit(this.navs.aim);
    }

    toVideo() {
        console.log('todo:打开视屏');
        this.openVideo.emit();
    }
}
